package bma.common.langutil.xdom;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import junit.framework.TestCase;
import bma.common.langutil.bean.impl.BeanTestObject;
import bma.common.langutil.xdom.bean.Xdom4Bean;

public class XdomTC extends TestCase {

	public void testBean() {
		BeanTestObject o = new BeanTestObject();
		List<String> roomId = new ArrayList<String>();
		roomId.add("001");
		roomId.add("002");
		o.setRoomId(roomId);
		Map<String,String> attr = new HashMap<String, String>();
		attr.put("n1", "v1");
		attr.put("n2", "v2");
		o.setAttributes(attr);
		
		Xdom4Bean xbean = new Xdom4Bean();
		Xdom xdom = xbean.bind(o);
		
		StringBuilder sb = new StringBuilder();
		XdomUtil.toString(xdom, sb);
		System.out.println(sb.toString());
	}
}
